home *** CD-ROM | disk | FTP | other *** search
- LISTING 7 - Illustrates a dynamic array
-
- #include <iostream.h>
- #include <dynarray.h>
-
- main()
- {
- const size_t NSTRINGS = 5;
- char *strings[NSTRINGS] =
- {"Go","west","young","C++","hacker"};
- dynarray<char *> strvec;
-
- for (int i = 0; i < NSTRINGS; ++i)
- strvec.append(strings[i]);
- for (i = 0; i < strvec.length(); ++i)
- cout << strvec[i] << endl;
- return 0;
- }
-
- /* Output:
- Go
- west
- young
- C++
- */
-